package com.zzedu.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zzedu.common.annotation.Excel;
import jakarta.validation.constraints.NotNull;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * (教育-学校)设备登录信息对象 zz_app_device_login
 * 
 * @author Mr.Wang
 * @date 2025-06-02
 */
@TableName("zz_app_device_login")
public class ZzAppDeviceLogin implements Serializable
{
    private static final long serialVersionUID = 1L;

    /** id */
    @TableId(type = IdType.AUTO)
    private Long id;

    /** 设备序id */
    @Excel(name = "设备序id")
    private Long deviceId;

    /** 添加时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "添加时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    @NotNull(message = "添加时间不能为空")
    private LocalDateTime gmtCreate;

    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.UPDATE)
    @NotNull(message = "更新时间不能为空")
    private LocalDateTime gmtModify;

    /** 逻辑删除(0：未删除 1：id) */
    @Excel(name = "逻辑删除(0：未删除 1：id)")
    @TableLogic(delval = "id")
    @TableField(fill = FieldFill.INSERT)
    @NotNull(message = "逻辑删除(0：未删除 1：id)不能为空")
    private Integer deleted;

    /** 创建人 */
    @TableField(fill = FieldFill.INSERT)
    private Long createBy;

    /** 修改人 */
    @TableField(fill = FieldFill.UPDATE)
    private Long updateBy;

    private String ip;


    private String location;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setDeviceId(Long deviceId) 
    {
        this.deviceId = deviceId;
    }

    public Long getDeviceId() 
    {
        return deviceId;
    }
    public void setGmtCreate(LocalDateTime gmtCreate) 
    {
        this.gmtCreate = gmtCreate;
    }

    public LocalDateTime getGmtCreate() 
    {
        return gmtCreate;
    }
    public void setGmtModify(LocalDateTime gmtModify) 
    {
        this.gmtModify = gmtModify;
    }

    public LocalDateTime getGmtModify() 
    {
        return gmtModify;
    }
    public void setDeleted(Integer deleted) 
    {
        this.deleted = deleted;
    }

    public Integer getDeleted() 
    {
        return deleted;
    }
    public void setCreateBy(Long createBy) 
    {
        this.createBy = createBy;
    }

    public Long getCreateBy() 
    {
        return createBy;
    }
    public void setUpdateBy(Long updateBy) 
    {
        this.updateBy = updateBy;
    }

    public Long getUpdateBy() 
    {
        return updateBy;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    @Override
    public String toString() {
        return  ToStringBuilder.reflectionToString(this,ToStringStyle.JSON_STYLE);
    }
}
